#pragma once

#include "DXUT.h"
struct AxisAlignedBox
{
	D3DXVECTOR3 Center;           
	D3DXVECTOR3 Extents;            
};

struct OrientedBox
{
	D3DXVECTOR3 Center;           
	D3DXVECTOR3 Extents;           
	D3DXQUATERNION  Orientation;     
};

struct BoundingBox
{

	BoundingBox(const D3DXVECTOR3 &  vMax , const D3DXVECTOR3 & vMin)
	{
		max = vMax;
		min = vMin;
	}
	BoundingBox()
	{
		max = D3DXVECTOR3(-10000.0f, -10000.0f, -10000.0f);
		min = D3DXVECTOR3(10000.0f, 10000.0f, 10000.0f);
	}

	//BoundingBox(D3DXVECTOR3 _max, D3DXVECTOR3 _min)
	//{
	//	max = _max;
	//	min = _min;
	//}


	D3DXVECTOR3 min;  
	D3DXVECTOR3 max; 
 
};

 
struct BoundingSphere
{
	BoundingSphere()
	{
		centre = D3DXVECTOR3(0.0f, 0.0f, 0.0f);
		radius = 0.0f;
	}



	D3DXVECTOR3 centre; 
	float radius;  
};

 
struct Frustum
{
	 D3DXVECTOR3 Origin;           
	D3DXVECTOR3 Points[8];
};

void ComputeBoundingAxisAlignedBoxFromPoints( AxisAlignedBox* pOut, UINT Count, const D3DXVECTOR3* pPoints);
void ComputeFrustumFromProjection( Frustum* pOut, const D3DXMATRIX * pView,const D3DXMATRIX * pProjection );
void DrawFrustum( C3DLineManager * pLineManager, const Frustum& frustum, D3DCOLOR Color );
void DrawCube( C3DLineManager * pLineManager, const D3DXMATRIX& matWorld, D3DCOLOR Color );
void DrawBox( C3DLineManager * pLineManager, const D3DXMATRIX & matWorld, const class  BoundingBox & box ,D3DCOLOR Color );
void DrawBoundingBox( C3DLineManager * pLineManager, const D3DXMATRIX  * pmatWorld,   class  BoundingBox  * box ,D3DCOLOR Color );
void DrawSphere( BoundingSphere & sphere, D3DCOLOR Color);
void DrawRing( IDirect3DDevice9* pd3dDevice, const D3DXVECTOR3 & Origin, const D3DXVECTOR3 & MajorAxis,const D3DXVECTOR3& MinorAxis, D3DCOLOR Color );

 